import { createSlice } from '@reduxjs/toolkit';
// 学校slice
const schoolSlice = createSlice({
  name: 'school',
  initialState: {
    name: '小学',
    address: '小学路1号'
  },
  reducers: {
    setName(state, action) {
      state.name = action.payload;
    },
    setAddress(state, action) {
      state.address = action.payload;
    }
  }
});
export const { setName, setAddress } = schoolSlice.actions;
export const { reducer: schoolReducer } = schoolSlice;